#include<iostream>
#include<cstring>

using namespace std;


int arr[1005];
int test[1005];

bool compare(int x) {
	int size = 0;
	while(x) {
		test[size++] = x % 10;
		x /= 10;
	}
	for(int i = 0; i < size / 2; i++) {
		if(test[i] != test[size - 1 - i]) {
			return false;
		}
	}
	return true;
}

int reverse(int x) {
	int num = 0;
	while(x) {
		num = num * 10 + x % 10;
		x = x / 10;
	}
	return num;
}

int main(void) {
	int n;
	cin >> n;
	int ans = 0;
	arr[ans++] = n;
	while(!compare(n)) {
		n += reverse(n);
		arr[ans++] = n;
	}
	cout << ans - 1 << endl;
	for(int i = 0; i < ans; i++) {
		if(i != ans - 1) {
			cout << arr[i] << "--->" ;
		} else {
			cout << arr[i];
		}
	}
	return 0;
} 
